const path = require('path')

module.exports = (config) => {
    const loaderPath = path.resolve(__dirname, './index')
    // console.log('loaderPath', loaderPath)
    const svgRule = config.module.rules.find(rule => rule.test.test('.svg'))
    svgRule.test = /\.(png|jpe?g|gif|webp)$/
    config.module.rules.push({
        test: /\.svg$/,
        use: ['vue-loader', {
            loader: loaderPath,
        }],
    })
}